package com.diligreat.tag; 

import java.io.IOException;
import java.text.SimpleDateFormat;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import com.diligreat.util.CodeTransUtil;
import com.diligreat.util.Constants;

/**  
 * @Author Bruce 
 * @Date 2012-11-4
 * @Comments
 */
public class FormatDateFromLong extends TagSupport {

	private static final long serialVersionUID = 1L;
	private static final SimpleDateFormat df = new SimpleDateFormat(Constants.DATE);
	
	private long longTime;
	
	@Override
	public int doStartTag() throws JspException {
		//System.out.println("in CodeTranslateTag code="+code);
		try {
			pageContext.getOut().write(df.format(longTime));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return super.doStartTag();
	}

	public long getLongTime() {
		return longTime;
	}

	public void setLongTime(long longTime) {
		this.longTime = longTime;
	}
	
	
}
 